require 'sinatra/base'
require 'json'

require './helpers/response'

class ErrorHandler < Sinatra::Base
    not_found do
        content_type :json
        Response.new("Invalid Route").to_json
    end

    error do
        p env["sinatra.error"]
        Response.new(env["sinatra.error"]).to_json
    end
end
